using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Admin2022Soft2.Domain.Entity;
using Admin2022Soft2.Infrastructrue.Persistence.Configuration.Base;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Admin2022Soft2.Infrastructrue.Persistence.Configuration
{
    public class AppFileInformationConfiguration : BaseEntityConfiguration<AppFileInformation>
    {
        public override void Configure(EntityTypeBuilder<AppFileInformation> builder)
        {
            base.Configure(builder);

            //设置表名，查了老半天才查到原来设置表名方法是这个，残念。。。熬了个大夜
            builder.ToTable("app_file_information");

            builder.Property(x => x.OriginName).HasColumnName("origin_name").HasColumnType("text").HasColumnOrder(1);
            builder.Property(x => x.CurrentName).HasColumnName("current_name").HasColumnType("text").HasColumnOrder(2);
            builder.Property(x => x.RelativePath).HasColumnName("relative_path").HasColumnType("text").HasColumnOrder(3);
            builder.Property(x => x.FileSize).HasColumnName("file_size").HasColumnOrder(4);
            builder.Property(x => x.FileType).HasColumnName("file_type").HasColumnType("text").HasColumnOrder(5);
        }
    }
}